package com.nbsaas.boot.data.rest.resource;

import com.nbsaas.boot.data.api.apis.QueryDebugApi;
import com.nbsaas.boot.data.data.entity.QueryDebug;
import com.nbsaas.boot.data.api.domain.request.QueryDebugRequest;
import com.nbsaas.boot.data.api.domain.response.QueryDebugResponse;
import com.nbsaas.boot.data.api.domain.simple.QueryDebugSimple;
import com.nbsaas.boot.data.rest.convert.QueryDebugSimpleConvert;
import com.nbsaas.boot.data.rest.convert.QueryDebugEntityConvert;
import com.nbsaas.boot.data.rest.convert.QueryDebugResponseConvert;
import com.nbsaas.boot.data.data.repository.QueryDebugRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   调试记录-业务接口实现
*/
@Transactional
@Service
public class QueryDebugResource extends BaseResource<QueryDebug,QueryDebugResponse, QueryDebugSimple, QueryDebugRequest>  implements QueryDebugApi {

    @Resource
    private QueryDebugRepository queryDebugRepository;

    @Override
    public JpaRepositoryImplementation<QueryDebug, Serializable> getJpaRepository() {
        return queryDebugRepository;
    }

    @Override
    public Function<QueryDebug, QueryDebugSimple> getConvertSimple() {
        return new QueryDebugSimpleConvert();
    }

    @Override
    public Function<QueryDebugRequest, QueryDebug> getConvertForm() {
        return new QueryDebugEntityConvert();
    }

    @Override
    public Function<QueryDebug, QueryDebugResponse> getConvertResponse() {
        return new QueryDebugResponseConvert();
    }




}


